// import './assets/main.css'
import './styles/common.scss'
import { createApp } from 'vue'
import { createPinia } from 'pinia'
// elementPlus
// import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
// pinia
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
import App from './App.vue'
import router from './router'
// 引入echarts
// import ECharts from 'vue-echarts'
import * as echarts from 'echarts'


// // 引入echarts核心模块
// import * as echarts from 'echarts/core';
// // 引入柱状图图表
// import { BarChart } from 'echarts/charts';
// // 引入提示框和标题组件
// import { TitleComponent, TooltipComponent } from 'echarts/components';
// // 引入Canvas渲染器
// import { CanvasRenderer } from 'echarts/renderers';

// // 注册必须的组件
// echarts.use([TitleComponent, TooltipComponent, BarChart, CanvasRenderer]);


const app = createApp(App)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

// 全局挂载 echarts
app.config.globalProperties.$echarts = echarts

app.use(router)
const pinia = createPinia()
pinia.use(piniaPluginPersistedstate)
app.use(pinia)
// app.use(ElementPlus)
app.mount('#app')
